package zhoug.chart.axis;

import android.graphics.Typeface;

import com.github.mikephil.charting.components.XAxis;
import com.github.mikephil.charting.formatter.ValueFormatter;
import zhoug.chart.formatters.MPAxisTextValueFormatter;

/**自定义x轴 支持绘制排序
 * @Author: zhoug
 * @Date: 2024-07-29
 * @Description:
 */
public class MPXAxis  extends XAxis {
    /**
     * 是否绘制排名
     * true:x轴label名字前面绘制排名
     * {@link  #setValueFormatter(ValueFormatter)} 使用{@link MPAxisTextValueFormatter}
     */
    protected boolean drawRinking=false;
    /**
     * 排名文字颜色
     */
    protected int rinkingTextColor=0;
    /**
     * 排名文字大小
     */
    protected int rinkingTextSize=0;
    /**
     * 排名文字样式
     */
    protected Typeface rinkingTextTypeFace=null;

    public void setDrawRinking(boolean drawRinking) {
        this.drawRinking = drawRinking;
    }

    public boolean isDrawRinking() {
        return drawRinking;
    }

    public int getRinkingTextColor() {
        return rinkingTextColor;
    }

    public void setRinkingTextColor(int rinkingTextColor) {
        this.rinkingTextColor = rinkingTextColor;
    }

    public int getRinkingTextSize() {
        return rinkingTextSize;
    }

    public void setRinkingTextSize(int rinkingTextSize) {
        this.rinkingTextSize = rinkingTextSize;
    }

    public Typeface getRinkingTextTypeFace() {
        return rinkingTextTypeFace;
    }

    public void setRinkingTextTypeFace(int typeFace) {
        this.rinkingTextTypeFace = Typeface.defaultFromStyle(typeFace);
    }
}
